﻿using Adnc.Infra.Entities;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;

namespace WYT.Ord.Repository.Entities
{
    /// <summary>
    /// 订单商品
    /// </summary>
    [Table("ord_orderGoods"), Comment("订单商品")]
    public class OrderGoods : EfEntity
    {
        /// <summary>
        /// 订单ID
        /// </summary>
        [Comment("订单Id")]
        public long OrderId { get; set; }

        /// <summary>
        /// 用户ID
        /// </summary>
        [Comment("用户ID")]
        public long UserId { get; set; }

        /// <summary>
        /// 订单商品
        /// </summary>
        [Comment("订单商品")]
        public long GoodsId { get; set; }

        /// <summary>
        /// 商品名称
        /// </summary>
        [Comment("商品名称")]
        public string GoodsName { get; set; }

        /// <summary>
        /// 商品规格
        /// </summary>
        [Comment("商品规格")]
        public long GoodsSizeId { get; set; }

        /// <summary>
        /// 规格名称
        /// </summary>
        [Comment("规格名称")]
        public string GoodsSizeName { get; set; }

        /// <summary>
        /// 是否是第三方商品
        /// </summary>
        [Comment("是否是第三方商品")]
        public bool IsThirdParties { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [Comment("商品类型")]
        public int GoodsType { get; set; }

        /// <summary>
        /// 数量
        /// </summary>
        [Comment("数量")]
        public int Quantity { get; set; }

        /// <summary>
        /// 商品价格
        /// </summary>
        [Comment("商品价格"), Column(TypeName = "decimal(18,2)")]
        public decimal Price { get; set; }

        /// <summary>
        /// 商品总价
        /// </summary>
        [Comment("商品总价"), Column(TypeName = "decimal(18,2)")]
        public decimal TotalPrice { get; set; }

        /// <summary>
        /// 邮费
        /// </summary>
        [Comment("邮费"), Column(TypeName = "decimal(18,2)")]
        public decimal Postage { get; set; }

        /// <summary>
        /// 商品图片
        /// </summary>
        [Comment("商品图片"), MaxLength(500)]
        public string GoodsImage { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [Comment("商品镜像")]
        public string ImagesGoods { get; set; }

        /// <summary>
        /// 商品状态  -1：已退货，0：未发货，1：已发货，2：已收货，3：已评论
        /// </summary>
        [Comment("商品状态  -1：已退货，0：未发货，1：已发货，2：已收货，3：已评论")]
        public int State { get; set; }

        /// <summary>
        /// 发货时间
        /// </summary>
        [Comment("发货时间")]
        public DateTime? SendTime { get; set; }
        /// <summary>
        /// 收货时间
        /// </summary>
        [Comment("收货时间")]
        public DateTime? ConfirmTime { get; set; }

        /// <summary>
        /// 是否是赠品
        /// </summary>
        [Comment("是否是赠品")]
        public bool IsGift { get; set; } = false;

        /// <summary>
        /// 赠送此赠品的订单商品Id
        /// </summary>
        [Comment("赠送此赠品的订单商品Id")]
        public long? ParentOrderGoodsId { get; set; }

        /// <summary>
        /// 赠品ID
        /// </summary>
        [Comment("赠品ID")]
        public long? GiftId { get; set; }

        /// <summary>
        /// 是否使用抵扣券
        /// </summary>
        [Comment("是否使用抵扣券")]
        public bool UseDeductionCoupons { get; set; } = false;
    }
}
